package org.android.brasil.projetos.oktoberfest2011.view;

import org.android.brasil.projetos.oktoberfest2011.R;
import org.android.brasil.projetos.oktoberfest2011.utils.AnalyticsUtils;
import org.android.brasil.projetos.oktoberfest2011.view.controller.ComoChegarController;
import org.android.brasil.projetos.oktoberfest2011.view.controller.MapaController;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;

public class MapaTabView extends TabActivity {

	private TabHost tabHost;
	private AnalyticsUtils mGa;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		this.mGa = AnalyticsUtils.getInstance(this);
		
		setContentView(R.layout.mapa_tab_view);

		bindScreenFields();
		populateFields();
		
		this.mGa.trackScreen(getString(R.string.mapa));

	}

	private void bindScreenFields() {
		tabHost = getTabHost();
	}

	private void populateFields() {


		TabHost.TabSpec spec;
		Intent intent = new Intent().setClass(this, MapaController.class);
		String set  = getResources().getString(R.string.mapa);
		spec = tabHost.newTabSpec(set)
				.setIndicator(set, getResources().getDrawable(R.drawable.mapa_local))
				.setContent(intent);

		tabHost.addTab(spec);

		
		TabHost.TabSpec spec1;
		Intent intent1 = new Intent().setClass(this, ComoChegarController.class);

		String set1  = getResources().getString(R.string.como_chegar);
		spec1 = tabHost.newTabSpec(set1)
				.setIndicator(set1, getResources().getDrawable(R.drawable.como_chegar))
				.setContent(intent1);

		tabHost.addTab(spec1);

	}

	protected void onDestroy() {
		super.onDestroy();
	}
}
